package cn.edu.scau.cmi.chenyuesong.spring;

import org.springframework.context.ApplicationContext;

import cn.edu.scau.cmi.chenyuesong.spring.entity.Student;
import cn.edu.scau.cmi.chenyuesong.spring.util.ApplicationContextUtil;
import javafx.fxml.FXML;
import javafx.scene.control.TextField;

public class myController {
	@FXML
	private TextField t1,t2;
	private static ApplicationContext applicationContext;
	
	@FXML
	private void initialize() {
		applicationContext = ApplicationContextUtil.getApplicationContext();
		Student zhangsan =(Student) applicationContext.getBean("zhangsan");
	    t1.appendText(zhangsan.getName());
		t2.appendText(zhangsan.getTeacher().getName());
	}
}
